1. Field of the Invention
The present invention relates to an apparatus and a method for processing image data containing a background image and a desired foreground image.
2. Description of the Related Art
A device that processes checks, for example, as described in Japanese Unexamined Patent Appl. Pub. 2004-123117 is one example of an image processing apparatus. This check processing device optically scans a check or other type of financial instrument to capture an image of the instrument. To reduce the size of the image data, the raw image data from the scanned instrument (such as gray scale image data) is digitized to produce a two-valued (black and white) image of the instrument, which is assumed to be a check below. Particular information on the check (such as the bank name, account number, amount, payee, payer name and payer signature, referred to as the “payment information” below) must be clearly visible in the digitized image data. Instruments such as checks typically have a background image, which may be a simple pattern or a picture, for example, printed on the front, and the payment information is printed or written over this background image.
The technology taught in Japanese Unexamined Patent Appl. Pub. 2004-123117 is characterized by dynamically changing the threshold level used for digitizing the raw image data based on the image characteristics of the specific check so that the background image can be removed from the raw image data and a clear image of the desired payment information that is being read can be extracted. More specifically, selected parts of the check are scanned before scanning the entire check to generate a histogram of the density (brightness) distribution in the image data captured from those selected parts. The threshold level used for digitizing is then calculated based on this histogram.
The technology taught in Japanese Unexamined Patent Appl. Pub. 2004-123117 for dynamically adjusting the digitizing threshold level based on image characteristics in the raw image data is particularly effective for extracting a desired foreground image, such as the payment information on a check, from the raw image data of the check. However, this technology leaves a number of problems.
First, the payment information on a check often contains image elements that are finer than the scanning resolution (such as fine line elements that are narrower than the width of one pixel in the scanned image data), and such ultrafine line elements are lost by the digitizing process. More specifically, such fine image elements are expressed as low density gray image elements, and are converted to white pixels, that is, deleted, by the digitizing process.
Second, the background images on checks and other instruments vary widely, the density distribution differs with each background image, and the density range of the background image may overlap the density range of the foreground image (the check payment information). As a result, the digitizing process also extracts a part of the background image as a black area together with the desired foreground image. If the foreground image overlaps the part of the background image that is extracted as a black area, the foreground image cannot be distinguished from the background image in the digitized image data.
This problem is not limited to processing financial instruments, and also occurs when scanning documents and in other image processing applications.